package com.zjxmyq.microserviceyida.service;

import com.alibaba.fastjson.JSONObject;
import com.zjxmyq.domain.result.RestResponse;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.HashMap;

@Service
@Slf4j
public class YiDaService {

    @Resource YidaClient yidaClient;
    public JSONObject test(){
        JSONObject req = new JSONObject();
        req.put("formUuid","FORM-D80B29E10C8D427CBB420EBB58A2BF8ABT1K");
        req.put("systemToken","2T866B81CKZF7JZHEESKE62O52S23DWSKP0PL13");
        req.put("userId","301546025724261514");
        req.put("appType","APP_TU1272RSPSUSZQTP1WRP");
        req.put("currentPage","currentPage");
        req.put("pageSize","pageSize");
     return  yidaClient.getInstanceIds(req);
    }

    /**
     * 获取实例ID列表
     * @param pageSize
     * @param pageNumber
     * @return
     */
    public Object getIdList(Integer pageSize, Integer pageNumber) {
        JSONObject req = new JSONObject();
        req.put("pageSize","pageSize");
        req.put("formUuid","FORM-D80B29E10C8D427CBB420EBB58A2BF8ABT1K");
        req.put("systemToken","2T866B81CKZF7JZHEESKE62O52S23DWSKP0PL13");
        req.put("userId","301546025724261514");
        req.put("pageSize","pageSize");
        req.put("appType","APP_TU1272RSPSUSZQTP1WRP");
        HashMap<String, Object> hp = new HashMap<>(req);
        hp.put("totalCount","totalCount");
        hp.put("pageNumber","pageNumber");
        hp.put("data","data");
        return yidaClient.getIdList(hp);
    }
    /**
     * 获取总工对象
     * @param formInstId
     * @return
     */
    public JSONObject getEngineerList(String formInstId) {
        return yidaClient.getEngineerList(formInstId,
                "APP_TU1272RSPSUSZQTP1WRP",
                "2T866B81CKZF7JZHEESKE62O52S23DWSKP0PL13",
                "301546025724261514");
    }


}
